package jf.jplayground.validation;
import java.util.List;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

public class BeanToValidate {

	@NotNull
	private String name; // will check if the name is set

	@Min(value = 3)
	@Max(value = 30)
	private int age; // will check if int is between 3 and 30

	@Pattern(regexp = ".+@.+\\..{2,4}")
	private String email;

	@Size(min = 2, max = 4)
	@NotNull
	private List<String> things; // will check if list has 2 to 4 items

	public BeanToValidate() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public List<String> getThings() {
        return things;
    }

    public void setThings(List<String> things) {
        this.things = things;
    }
	
}
